fix(agent_toolset): grep tolerates extra model-supplied args#1719
Open
nadavshohat wants to merge 1 commit into
Open
fix(agent_toolset): grep tolerates extra model-supplied args#1719nadavshohat wants to merge 1 commit into
nadavshohat wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
beta_grep_tool'sgrep(pattern, path)is registered with the fullagent_toolset_20260401grep schema, but its signature accepts onlypattern/path. When a model callsgrepwith any other argument,@beta_async_tool'svalidate_callrejects the whole call:This is not hypothetical: it happens in a real self-hosted
EnvironmentWorkersession. The model routinely emits Claude-Code-style grep options (output_mode,head_limit,-i, context lines) that are not in theGrepInputschema (which ispattern/pathonly). Every such call fails and the model gets a hard error instead of search results, sogrepis effectively unusable for those calls and the agent falls back tobash.Fix
Accept and ignore unknown keyword arguments in the reference
grepimplementation (**_ignored). The tool still searches bypattern/path; extra options are tolerated rather than fatal. Minimal, matches the schema's documented contract, and unblocks real agent runs.Notes
grepis changed; the other toolset functions weren't observed failing.output_mode/head_limitfor real could be a follow-up, but that would also need theGrepInputschema (Stainless-generated) to declare them.